package cn.ct.spring.controller2;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.ct.spring.model.User;

/**
 * 用户的控制器
 * 
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/user")
public class UserController {
	/**
	 * 查找用户
	 * 
	 * @return
	 */
	@RequestMapping("/get")
	public String getUser() {

		return "index";
	}

	/**
	 * 添加用户
	 * 
	 * @return
	 */
	@RequestMapping("/add")
	public String addUser() {

		return "index";
	}

	/**
	 * 删除用户
	 * 
	 * @return
	 */
	@RequestMapping("/del")
	public String delUser() {

		return "index";
	}

	/**
	 * 查找用户
	 * 
	 * @return
	 */
	@RequestMapping("/get1")
	@ResponseBody
	public User getUser1() {
	User user=new User();
	user.setUsername("笑话");
	user.setPassword("15866");
		return user;
	}
}
